﻿using System;

class SquareRoot
{
    static void Main()
    {
        Console.WriteLine("Write a number: ");
        try
        {
            int number = int.Parse(Console.ReadLine());

            if (number < 0)
            {
                Console.WriteLine("Number cannot be negative!!!");
                return;
            }

            double root = Math.Sqrt(number);
            Console.WriteLine("The result is {0}",root);
        }
        catch (Exception)
        {
            Console.WriteLine("Invalid number!");
        }
        finally
        {
            Console.WriteLine("Goodbye!");
        }
    }
}
